Copyright: A GUERIN & PASCALISSIME


Component Directory

properties	methods 	events

Unit

Director in Director.pas

Description:

With the component TDirectory you can get filenames from a directory.

You can choose which kind of files you want by including volumeID or Directory and/or hidden and/or sysfile  attributes or excluding archive and/or read-only attributes and even normal files.

You can choose to recurs into sub-directories or not, and if so, you can choose in which kind of sub-directory you will recurs.

For example: you can get archive and/or hidden files in the current directory and in all the archive and/or system sub-directories by including hidden files, excluding read-only and normal files, including system directories and excluding normal and read-only directories

In this version, this kind of directory filter is only implemented for sub-directories, not for the initial directory, (that you can choose by the property initialdir)

For getting the results, you have to implement the found method in the target program and read SelectedFileName in it.

You can also implement a cancel dialog where you can trigger the DoStop method


Property IncludeSystemDir

______________________

Boolean

If true, Sysfile directories are included in the sub-directories explored.


Event OnSearchStatus

___________________

This event is triggered when the property stopped is modified.


Event OnFound

______________

This event is triggered each time a new filename fitting the search criteria is found. By implementing a found method in the target program and reading the SelectedFileName property, you can get this new filename and what is useful with.


Property Version

______________

String

In the Version property is the version number of the current directory component and it's date.


Property SelectedFileName

_______________________

T_DirectoryName

In this property, you can find the name of the last found filename fitting the search criteria


Property DirectoryInTreatment

_________________________

String

In this property, you can read the name of the directory which is under treatment, i.e., the directory in which the filename search is on going. It's useful to show the search progress.


Property Stopped

_______________

Boolean

This property is set to true by the DoStop method. It could be tested inside a cancel procedure to know if the user triggered the abort function. When changed, the OnStatusChanged is triggered.


Directory Properties
TDirectory Properties

See also

Stopped Boolean run time, read-only

DirectoryInTreatment String run-time read only

SelectedFileName  String run-time read only

Version : String

InitialDir : T_DirectoryName

ExcludeNormalFiles : BOOLEAN

ExcludeReadOnlyFiles : BOOLEAN

ExcludeArchiveFiles : BOOLEAN

IncludeHiddenFiles : BOOLEAN

IncludeSystemFiles : BOOLEAN

IncludeVolumeID : BOOLEAN

IncludeDirectoryFiles : BOOLEAN

ExcludeReadOnlyDir : BOOLEAN

ExcludeArchiveDir : BOOLEAN

IncludeHiddenDir : BOOLEAN

IncludeSystemDir : BOOLEAN

InSubDirectories : BOOLEAN

OnlyDirectories : BOOLEAN

FileFilter : STRING

DirectoryFilter: STRING


T_DirectoryName
T_DirectoryName = String[MacDirectoryLength];

MaxDirectoryLength = 79;


seealsodirectoryprop
See Also

_______

tasks

methods


Directory Methods
TDirectory Methods

________________

See also

Create CONSTRUCTOR

Destroy DESTRUCTOR

Execute PROCEDURE

DoStop PROCEDURE


seealsodirectomethod
See Also

_______

tasks

properties


Directory Events
TDirectory Events

_______________

OnFound

OnSearchStatus


Constructor Create

________________

See also

CONSTRUCTOR Create(AOwner : TComponent); OVERRIDE;

Create a new directory component.


Property InitialDir

______________

T_DirectoryName

You can define the directory where the search starts.

If this property is not initialized or contains a null string, the search starts in the current directory (i.e., the directory that is selected when the search is started).


Destructor DESTROY

__________________

See Also

Quod Satis


Methode Execute
Method Execute

_____________

Starts the execution of the search


Methode DoStop
Method DoStop

_____________

This methods change the stopped property to true. When the property stopped is true, the execute loop ends even if all the directories are not treated.


seealsocreate
See also

_______

Destroy

Directory Methods


Property IncludeHiddenDir

______________________

Boolean

If true, hidden directories are included in the sub-directories explored.


Property ExcludeNormalFile
Property ExcludeNormalFiles

_______________________

Boolean

If True then Normal files are excluded from the found filenames.


Property ExcludeReadonlyFiles

__________________________

Boolean

When true, read-only file names are excluded from the found filenames.


Property ExcludeArchiveFiles

________________________

Boolean

When true, archive file names are excluded from found filenames.


Property IncludeHiddenFiles

________________________

Boolean

When true, hidden file names are included in the search and then in the found filenames.


Property IncludeSystemFiles

________________________

Boolean

When true, sysfile name files are included in the search and then in the found file names.


Property IncludeVolumeID

_____________________

Boolean

When true, the volume label is included in the found file names, for each directories for which a search is done. Is this case, it's better to change the In Subdirectories property to false.


Property IncludeDirectoryFiles

_________________________

Boolean

If true, Directory file names are included in the search and then in the found file names.


Property ExcludeReadOnlyDir

_________________________

Boolean

If true, read-only directory are excluded from the sub-directories explored.


Property ExcludeArchiveDir

_______________________

Boolean

If true, Archive directories are excluded from sub-directories explored


Property InSubDirectories

_____________________

Boolean

If true, file name search is done in all the sub-directories.


Property OnlyDirectories

____________________

Boolean

If true, only the directory file names are included in found filenames.


seealsodestroy
See Also

_______

Create

Directory Methods


Property ExcludeNormalDir

_______________________

Boolean

If true, normal directories are excluded from the found sub-directories


Property FileFilter

_______________

String

The filefilter property enables the input of a file filter mask. The syntax is the same than the syntax of the mask filter of the DOS DIR command.

There are only the files which match that mask in the result of the search.


Property DirectoryFilter

___________

String

The DirectoryFilter property enables the input of a directory filter mask. The syntax is the same than the syntax of the  mask filter of the DOS DIR command.

The search is only made in the subdirectories which match that mask.